package com.len.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotEmpty;

import com.len.validator.group.AddGroup;
import com.len.validator.group.UpdateGroup;

import lombok.Data;
import lombok.ToString;

@Table(name = "sys_user")
@Data
@ToString
public class SysUser {
    
	@Id
    @Column(name = "id")
    private String id;
	
	/**
	 * 账号
	 */
    @NotEmpty(message = "用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String username;
    
    /**
     * 密码
     */
    @NotEmpty(message = "密码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String password;
    
    /**
     * 年龄
     */
    private Integer age; 
    
    /**
     * 邮箱
     */
    private String email; 
    
    /**
     * 头像
     */
    private String photo;
    
    /**
     * 真实姓名
     */
    @Column(name = "real_name")
    private String realName; 

    @Column(name = "create_by")
    private String createBy;

    @Column(name = "update_by")
    private String updateBy;

    @Column(name = "create_date")
    private Date createDate;

    @Column(name = "update_date")
    private Date updateDate;

    /**
     * 0可用1封禁
     */
    @Column(name = "del_flag")
    private Byte delFlag;
}